package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.AlertDataHandleDto;
import com.zzyl.dto.AlertDataPageQueryDto;
import com.zzyl.dto.AlertRulePageQueryDto;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import com.zzyl.vo.AlertRuleVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ Description: 报警数据相关接口
 * @ BelongsProject: zzyl-cp
 * @ Author: G攀
 * @ CreateTime: 2024-09-14  16:37
 * @ Version: 1.0
 */
@RestController
@RequestMapping("/alert-data")
@Api(tags = "报警数据相关接口")
public class AlertDataController {

    @Autowired
    private AlertDataService alertDataService;

    @GetMapping("/pageQuery")
    @ApiOperation("分页获取告警数据")
    public ResponseResult<PageResponse<AlertDataVo>> getPage(AlertDataPageQueryDto dto) {
        return alertDataService.getPage(dto);
    }


    @PutMapping("/handleAlertData/{id}")
    @ApiOperation("处理报警数据")
    public ResponseResult handleAlertData(@PathVariable Long id, @RequestBody AlertDataHandleDto dataHandleDto) {
        // 处理报警数据
        alertDataService.handleAlertData(id, dataHandleDto);

        return ResponseResult.success();
    }

}
